home *** CD-ROM | disk | FTP | other *** search
/ Workbench Design / WB Collection.iso / datatypes / clidt / install < prev    next >
Text File  |  1996-04-07  |  4KB  |  160 lines

  1. ;
  2. ; $PROJECT: cli.datatype
  3. ;
  4. ; $VER: Install 39.1 (06.08.95)
  5. ;
  6. ; by
  7. ;
  8. ; Stefan Ruppert , Windthorststrasse 5 , 65439 Floersheim , GERMANY
  9. ;
  10. ; (C) Copyright 1995
  11. ; All Rights Reserved !
  12. ;
  13. ; $HISTORY:
  14. ;
  15. ; 06.08.95 : 039.001 : initial
  16. ;
  17.  
  18. (set cpu (database "cpu"))
  19.  
  20. (set #datatype "cli.datatype")
  21. (set #prefs    "cli.prefs")
  22. (set #datatype-desc "(DMS|Lha|Tar|Tar-GZip)")
  23.  
  24. (set mode
  25.       (askchoice
  26.             (prompt @app-name)
  27.             (help @askchoice-help)
  28.             (choices "Install" "Remove")
  29.       )
  30. )
  31.  
  32. (if mode
  33.           (set pmode "Remove")
  34.           (set pmode "Install")
  35. )
  36.  
  37. ; get classes dir
  38. (set classdir
  39.           (askdir
  40.                      (prompt "Where do the Classes belong")
  41.                      (help @askdir-help)
  42.                      (default "SYS:Classes")
  43.           )
  44. )
  45.  
  46. ; now do install or remove
  47. (if mode
  48.           ; Remove
  49.           (
  50.                      ; Show what we are doing
  51.                      (working "Removing " @app-name)
  52.  
  53.                      ; Remove the non-standard pieces
  54.                      (delete (tackon (tackon classdir "datatypes") #datatype))
  55.                      (run (cat "delete " (tackon "devs:datatypes" (cat #datatype-desc "#?"))))
  56.  
  57.                      ; Don't want to use the confusing "Installation Complete" message
  58.                      ; when what we really did was remove things...
  59.                      (message "The \"" @app-name "\" components "
  60.                                  "that you specified have been successfully removed")
  61.                      (exit (quiet))
  62.           )
  63.  
  64.           ; Install
  65.           (
  66.                      (working "Installing " @app-name)
  67.  
  68.                      (set #dtname (tackon "classes/datatypes" #datatype))
  69.  
  70.                      (if (OR (= cpu "68000") (= cpu "68010")) (set #proc 0))
  71.                      (if (OR (= cpu "68020") (= cpu "68030") (= cpu "68040") (= cpu "68060")) (set #proc 1))
  72.  
  73.                      ; choose cpu type
  74.                      (set #proc
  75.                         (askchoice
  76.                             (prompt (cat "There are different versions of \"" #datatype "\", each one optimized "
  77.                                              "for a specific CPU type. Please select one: "))
  78.                             (choices "MC68000" "MC68020")
  79.                             (help (cat "  Select here the CPU type that is installed in your system. "
  80.                                     "\n\n  Currently, this is a MC" cpu ".\n\n  If you select a certain CPU type "
  81.                                     "in the choice box, the \"" #datatype "\" will run on any CPU which "
  82.                                     "type is higher or equal to the selection. However, it won't "
  83.                                     "run on a system equipped with a lower type.\n\n"
  84.                                     @askchoice-help)
  85.                             )
  86.                             (default #proc)
  87.                         )
  88.                      )
  89.  
  90.                      (if (= 0 #proc) (set #suffix ".000"))
  91.                      (if (= 1 #proc) (set #suffix ".020"))
  92.  
  93.                      (copylib
  94.                                 (prompt (cat "Copying the Datatype"))
  95.                                 (help @copylib-help)
  96.                                 (source (cat (tackon "classes/datatypes" (cat #datatype #suffix))))
  97.                                 (dest (tackon classdir "Datatypes"))
  98.                                 (newname #datatype)
  99.                                 (confirm)
  100.                      )
  101.  
  102.                      ; Install the descriptors
  103.                      (copyfiles
  104.                                 (prompt "Copying the Descriptors")
  105.                                 (help @copyfiles-help)
  106.                                 (source "devs/datatypes")
  107.                                 (dest "DEVS:DataTypes")
  108.                                 (pattern "#?")
  109.                                 (infos)
  110.                                 (confirm)
  111.                      )
  112.  
  113.                      ; Install prefs file
  114.                      (if     (askbool
  115.                                           (prompt "Install Prefs file ?")
  116.                                           (help @askbool-help)
  117.                                 )
  118.                                 (
  119.                                           (copyfiles
  120.                                                      (help @copyfiles-help)
  121.                                                      (source (tackon "envarc/datatypes" #prefs))
  122.                                                      (dest "EnvArc:DataTypes")
  123.                                           )
  124.                                           (copyfiles
  125.                                                      (help @copyfiles-help)
  126.                                                      (source (tackon "envarc/datatypes" #prefs))
  127.                                                      (dest "Env:DataTypes")
  128.                                           )
  129.                                 )
  130.                      )
  131.  
  132.                      ; install doc file
  133.                      (copyfiles
  134.                                 (prompt "Copying autodoc file")
  135.                                 (help @copyfiles-help)
  136.                                 (source "doc")
  137.                                 (dest "AutoDocs:")
  138.                                 (pattern "#?")
  139.                                 (confirm)
  140.                      )
  141.  
  142.                      ; install AmigaGuide file
  143.                      (copyfiles
  144.                                 (prompt "Copying AmigaGuide file")
  145.                                 (help @copyfiles-help)
  146.                                 (source "help")
  147.                                 (dest "AmigaGuide:")
  148.                                 (pattern "#?")
  149.                                 (confirm)
  150.                      )
  151.  
  152.                      ; Tell the system about the new descriptors
  153.                      (run "C:AddDataTypes Refresh")
  154.  
  155.           )
  156. )
  157.  
  158. (set @default-dest classdir)
  159.  
  160.